package com.df.tank.strategy;

import com.df.tank.Bullet;
import com.df.tank.Tank;

public class DefaultFireStrategy implements FireStrategy{
    private static final DefaultFireStrategy instance = new DefaultFireStrategy();
    private DefaultFireStrategy(){}

    public static DefaultFireStrategy getInstance() {
        return instance;
    }
    @Override
    public void reload(Tank tank) {
        int bx = tank.getX() + Tank.WIDTH / 2 - Bullet.WIDTH / 2;
        int by = tank.getY() + Tank.HEIGHT / 2 - Bullet.HEIGHT / 2;
        new Bullet(bx, by, tank.getDir(), tank.getGroup(), tank.getTankFrame());
    }
}
